#ifndef OMNIBOX_H
#define OMNIBOX_H

#include <QWidget>
#include <QSignalMapper>
#include <QLineEdit>
#include <QLabel>
#include <QString>


class Omnibox : public QWidget
{
    Q_OBJECT
public:
    explicit Omnibox(QWidget *parent = 0);

    void setEchoMode(QLineEdit::EchoMode);
    void setLEFocus();
    void setModeLabel(const QString &str);
    QString getText();
    void clearText();

signals:
    void inputCommited(const QString &text);
    void inputChanged(const QString &text);
    void modeLabelClicked(const QString &text);
private:
    QSignalMapper *signalMapper;
    QLineEdit *le;
    QLabel *lblMode;
protected:
    bool eventFilter(QObject *obj, QEvent *event);
};

#endif // OMNIBOX_H
